# define common functions